// 活动卡片格式化日期函数
const activityFormatDate = (dateStr: string, showYear: boolean = true) => {
    const date = new Date(dateStr)
    const year = date.getFullYear()
    const month = date.getMonth() + 1
    const day = date.getDate()
    return showYear ? `${year}年${month}月${day}日` : `${month}月${day}日`
}

// 活动核销格式化日期函数
const writeOffFormatDate = (dateStr: string) => {
    const date = new Date(dateStr)
    const year = date.getFullYear()
    const month = String(date.getMonth() + 1).padStart(2, '0')
    const day = String(date.getDate()).padStart(2, '0')
    return `${year}.${month}.${day}`
}

export default {
    activityFormatDate,
    writeOffFormatDate
}